﻿Option Strict On
Module Module1

    Sub Main()
        'WAP to print 1 to 10 number series using do while loop (pre testing) condition
        'Logic(count <= 10)
        'Dim count As Integer = 1
        'Do While count <= 10
        '    Console.WriteLine(count)
        '    count += 1
        'Loop

        'Dim count As Integer = 1
        'Do Until count > 10
        '    Console.WriteLine(count)
        '    count += 1
        'Loop

        'Dim count As Integer = 1
        'Do
        '    Console.Write(count)
        '    count += 1
        'Loop While (count <= 10)

        'Dim count As Integer = 1
        'Do
        '    Console.Write(count)
        '    count += 1
        'Loop Until (count > 10)

        'Dim fnumber, snumber, tnumber As Integer
        ''fnumber = 40 : snumber = 50 : tnumber = 30
        'Console.WriteLine("Enter fnumber")
        'fnumber = Integer.Parse(Console.ReadLine())
        'If (fnumber > snumber) Then
        '    If (fnumber > tnumber) Then
        '        Console.Write("fnumber is greater")
        '    Else
        '        Console.Write("tnumber is greater")
        '    End If
        'Else
        '    If (snumber > tnumber) Then
        '        Console.WriteLine("Snumber is greater")
        '    Else
        '        Console.WriteLine("tnumber is greater")
        '    End If
        'End If

        'Dim sourceInteger, destiInteger As Integer
        'Console.WriteLine("Enter Source Value")
        'sourceInteger = Integer.Parse(Console.ReadLine())
        'Console.WriteLine("Enter Destination Value")
        'destiInteger = Integer.Parse(Console.ReadLine())
        'Console.Write("Your Given Range is" & vbNewLine)
        'Do While sourceInteger <= destiInteger
        '    Console.Write(sourceInteger & vbTab)
        '    sourceInteger += 1
        'Loop

        'Dim sourceInteger, destiInteger, countEven, countOdd As Integer
        'Console.WriteLine("Enter Source Value")
        'sourceInteger = Integer.Parse(Console.ReadLine())
        'Console.WriteLine("Enter Destination Value")
        'destiInteger = Integer.Parse(Console.ReadLine())
        'Console.Write("Even Value Range" & vbNewLine)
        'Console.Write("Even" & vbTab & "Odd" & vbNewLine)
        'Do While sourceInteger <= destiInteger
        '    If (sourceInteger Mod 2 = 0) Then
        '        Console.Write(sourceInteger & vbTab)
        '        countEven += 1
        '    Else
        '        Console.Write(sourceInteger & vbTab)
        '        Console.Write(vbNewLine)
        '        countOdd += 1
        '    End If
        '    sourceInteger += 1
        'Loop
        'Console.Write(vbNewLine & ".........................................................................." & vbNewLine)
        'Console.WriteLine("TEven" & vbTab & "TOdd" & vbNewLine & countEven & vbTab & countOdd)

        'Dim sval, count As Integer
        'sval = 1 : count = 0
        'Do While sval <= 3
        '    If (3 Mod sval = 0) Then
        '        count += 1
        '    End If
        '    sval += 1
        'Loop
        'If (count = 2) Then
        '    Console.WriteLine("Given No is Prime")
        'Else
        '    Console.WriteLine("Given No is not Prime")
        'End If


        'Dim sval, count, num As Integer
        'sval = 1 : count = 0
        'Console.WriteLine("Enter a No")
        'num = Integer.Parse(Console.ReadLine())
        'Do While sval <= num
        '    If (num Mod sval = 0) Then
        '        count += 1
        '    End If
        '    sval += 1
        'Loop
        'If (count = 2) Then
        '    Console.WriteLine("Given No is Prime")
        'Else
        '    Console.WriteLine("Given No is not Prime")
        'End If

        'Dim sval, sourceInteger, destiInteger, count, num As Integer
        'count = 0
        'sval = 1
        'Console.WriteLine("Enter Source Value")
        'sourceInteger = Integer.Parse(Console.ReadLine())
        'Console.WriteLine("Enter Destination Value")
        'destiInteger = Integer.Parse(Console.ReadLine())
        'Do While sourceInteger <= destiInteger
        '    Do While sval <= sourceInteger
        '        If (sourceInteger Mod sval = 0) Then
        '            count += 1
        '        End If
        '        sval += 1
        '    Loop
        '    If (count = 2) Then
        '        Console.Write(sourceInteger & vbTab)
        '    End If
        '    count = 0
        '    sval = 1
        '    sourceInteger += 1
        'Loop

        'Dim num, sval, strfactval As Double
        'sval = 1 : strfactval = 1
        'Console.WriteLine("Enter a no:-")
        'num = Double.Parse(Console.ReadLine())
        'Do While num >= sval
        '    Console.Write(num & "*")
        '    strfactval *= num
        '    num -= 1
        'Loop
        'Console.Write(vbBack)
        'Console.WriteLine("=" & strfactval)

        'Dim sourceinteger, destiinteger, strfactval, temp As Double
        'strfactval = 1
        'Console.WriteLine("enter source value")
        'sourceinteger = Double.Parse(Console.ReadLine())
        'Console.WriteLine("enter destination value")
        'destiinteger = Double.Parse(Console.ReadLine())
        'Console.Write("Value" & vbTab & "Factorial" & vbNewLine)
        'Console.Write("........................................" & vbNewLine)
        'Do While sourceinteger <= destiinteger
        '    temp = sourceinteger
        '    Do While temp >= 1
        '        strfactval *= temp
        '        temp -= 1
        '    Loop
        '    Console.Write(sourceinteger & vbTab & strfactval & vbNewLine)
        '    strfactval = 1
        '    sourceinteger += 1
        'Loop

        'Dim fnumber, snumber, tnumber, sval As Integer
        'fnumber = 0 : snumber = 1 : sval = 1
        'Console.Write(fnumber & vbTab & snumber & vbTab)
        'Do While sval <= 6
        '    tnumber = fnumber + snumber
        '    fnumber = snumber
        '    snumber = tnumber
        '    Console.Write(tnumber & vbTab)
        '    sval += 1
        'Loop

        'Dim tblval, sval As Integer
        'sval = 1
        'Console.Write("Enter a no:-")
        'tblval = Integer.Parse(Console.ReadLine())
        'Do While sval <= 10
        '    Console.Write(tblval & "*" & sval & "=" & (tblval * sval) & vbNewLine)
        '    sval += 1
        'Loop

        'Dim tblsval, tbldval, sval As Integer
        'sval = 1
        'Console.Write("Enter Source:-")
        'tblsval = Integer.Parse(Console.ReadLine())
        'Console.Write("Enter Destination:-")
        'tbldval = Integer.Parse(Console.ReadLine())
        'Do While tblsval <= tbldval
        '    Do While sval <= 10
        '        Console.Write(tblsval * sval & vbTab)
        '        sval += 1
        '    Loop
        '    Console.Write(vbNewLine)
        '    sval = 1
        '    tblsval += 1
        'Loop

        'Dim lval, strrevval, num As Integer
        'strrevval = 0
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'Do While num > 0
        '    lval = num Mod 10
        '    strrevval = (strrevval * 10) + lval
        '    num \= 10
        'Loop
        'Console.WriteLine("Reverse No=" & strrevval)

        'Dim lval, strrevval, num, temp As Integer
        'strrevval = 0
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'temp = num
        'Do While num > 0
        '    lval = num Mod 10
        '    strrevval = (strrevval * 10) + lval
        '    num \= 10
        'Loop
        'If (temp = strrevval) Then
        '    Console.WriteLine("Given No is Palidrom")
        'Else
        '    Console.WriteLine("Given No is Not Palidrome")
        'End If

        'Dim sval, dval, lval, strrevval, temp As Integer
        'strrevval = 0
        'Console.Write("Enter Source Value:-")
        'sval = Integer.Parse(Console.ReadLine())
        'Console.Write("Enter Destination Value:-")
        'dval = Integer.Parse(Console.ReadLine())
        'Do While sval <= dval
        '    temp = sval
        '    Do While temp > 0
        '        lval = temp Mod 10
        '        strrevval = (strrevval * 10) + lval
        '        temp \= 10
        '    Loop
        '    If (sval = strrevval) Then
        '        Console.Write(strrevval & vbTab)
        '    End If
        '    strrevval = 0
        '    sval += 1
        'Loop

        'Dim lval, strrevval, num, temp, count, sval As Integer
        'strrevval = 0
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'temp = num
        'sval = 1
        'count = 0
        'Do While temp > 0
        '    temp \= 10
        '    count += 1
        'Loop
        'temp = num
        'Do While num > 0
        '    lval = num Mod 10
        '    strrevval = CType(strrevval + (lval ^ count), Integer)
        '    num \= 10
        'Loop
        'If (temp = strrevval) Then
        '    Console.WriteLine("Given No is Armstrong")
        'Else
        '    Console.WriteLine("Given No is Not Armstrong")
        'End If

        'Dim lval, strrevval, sval, dval, temp, count As Integer
        'strrevval = 0
        'Console.Write("Enter Source Value:-")
        'sval = Integer.Parse(Console.ReadLine())
        'Console.Write("Enter Destination Value:-")
        'dval = Integer.Parse(Console.ReadLine())

        'Do While sval <= dval
        '    temp = sval
        '    count = 0
        '    Do While temp > 0
        '        temp \= 10
        '        count += 1
        '    Loop
        '    temp = sval
        '    Do While temp > 0
        '        lval = temp Mod 10
        '        strrevval = CType(strrevval + (lval ^ count), Integer)
        '        temp \= 10
        '    Loop
        '    If (sval = strrevval) Then
        '        Console.Write(strrevval & vbTab)
        '    End If
        '    sval += 1
        '    strrevval = 0
        'Loop

        'Dim num, sval As Integer
        'sval = 1
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'Do While sval <= num
        '    If (num Mod sval = 0) Then
        '        Console.Write(sval & vbTab)
        '    End If
        '    sval += 1
        'Loop

        'Dim num, sval, strfacval, temp As Integer
        'sval = 1
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'temp = num
        'Do While sval < num
        '    If (num Mod sval = 0) Then
        '        strfacval += sval
        '    End If
        '    sval += 1
        'Loop
        'If (temp = strfacval) Then
        '    Console.Write("Given No is Perfect Number")
        'Else
        '    Console.Write("Given No is Not Perfect Number")
        'End If

        'Dim sourceval, destval, inival, temp, strfactval As Integer
        'inival = 1
        'Console.Write("Enter Source Value")
        'sourceval = Integer.Parse(Console.ReadLine())
        'Console.Write("Enter Destination Value")
        'destval = Integer.Parse(Console.ReadLine())
        'Do While sourceval <= destval
        '    temp = sourceval
        '    Do While inival < temp
        '        If (temp Mod inival = 0) Then
        '            strfactval += inival
        '        End If
        '        inival += 1
        '    Loop
        '    If (sourceval = strfactval) Then
        '        Console.Write(sourceval & vbTab)
        '    End If
        '    inival = 1
        '    strfactval = 0
        '    sourceval += 1
        'Loop

        'Dim num, remval As Integer
        'Console.Write("Enter a no:-")
        'num = Integer.Parse(Console.ReadLine())
        'Do While num > 0
        '    remval = num Mod 2
        '    Console.Write(remval)
        '    num \= 2
        'Loop

        'Dim arr() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
        ''Console.Write(arr.Length.ToString())
        'Dim count As Integer
        'For count = 0 To arr.Length - 1
        '    Console.WriteLine(arr(count))
        'Next

        'Const keyname As Char = "A"c
        'Console.WriteLine(Asc(keyname))

        'Dim arr(5) As Integer

        'arr(0) = 10
        'arr(1) = 20
        'arr(2) = 30
        'arr(3) = 40
        'arr(4) = 50

        ''Console.Write(arr(4))
        'Dim count As Integer = 0
        'For count = 0 To 4
        '    Console.WriteLine(arr(count))
        'Next

        'Dim studnameString() As String = {"Raushan", "Mohan", "Sohan", "Shyam", "Anupriya"}
        'Dim count As Integer = 0
        'For count = 0 To studnameString.Length - 1
        '    Console.WriteLine("arr{" & count & "}=" & studnameString(count))
        'Next

        'Dim arr() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}
        'For count As Integer = 1 To arr.Length - 1
        '    If (arr(count) Mod 2 = 0) Then
        '        Console.Write("arr{" & count & "}=" & arr(count) & vbNewLine)
        '    End If
        'Next

        'Dim num, unival, lval, count As Integer
        'Dim strunitval As Double
        'num = 65432 : unival = 5 : count = 0 : strunitval = 0
        'Do While num > 0
        '    lval = num Mod 10
        '    count += 1
        '    If (lval = unival) Then
        '        If (count = 1) Then
        '            strunitval *= lval
        '            Console.Write(strunitval)
        '        Else
        '            strunitval += lval * (10 ^ (count - 1))
        '            Console.Write(strunitval)
        '            Return
        '        End If
        '    End If
        '    num \= 10
        'Loop

        'Dim fnumber, snumber, tnumber, sval, temp As Integer
        'fnumber = 0 : snumber = 1 : sval = 1 : temp = 1 : tnumber = 0
        'Do While sval <= 20
        '    If (sval Mod 2 = 0) Then
        '        If (sval = 2) Then
        '            Console.Write("place{" & sval & "}=" & fnumber & "," & snumber)
        '        Else
        '            Console.Write("place{" & sval & "}=" & fnumber & "," & snumber)
        '            Do While temp <= (sval - 2)
        '                tnumber = fnumber + snumber
        '                fnumber = snumber
        '                snumber = tnumber
        '                Console.Write("," & tnumber)
        '                temp += 1
        '            Loop
        '            temp = 1
        '            fnumber = 0 : snumber = 1

        '        End If
        '        Console.Write(vbNewLine)
        '        Console.Write(vbBack)
        '    End If
        '    sval += 1
        'Loop


        'Dim number, powval, sval, spowerval As Integer
        'number = 4 : powval = 2 : sval = 1 : spowerval = 1
        'Do While sval <= powval
        '    spowerval *= number
        '    sval += 1
        'Loop
        'Console.Write(spowerval)

        Dim sourceval, destval, powval, sval, spowerval, temp As Double
        sval = 1 : spowerval = 1
        Console.Write("Enter Source Value:=")
        sourceval = Integer.Parse(Console.ReadLine())
        Console.Write("Enter Destination Value:=")
        destval = Integer.Parse(Console.ReadLine)
        Console.Write("Enter Power Value:=")
        powval = Integer.Parse(Console.ReadLine())
        Do While sourceval <= destval
            temp = sourceval
            Do While sval <= powval
                spowerval *= temp
                sval += 1
            Loop
            Console.Write(sourceval & "^" & powval & "=" & spowerval & vbNewLine)
            sval = 1
            spowerval = 1
            sourceval += 1
        Loop

    End Sub

End Module
